/* TotalDcmListerPlugin.h -- Header file for class TotalDcmListerPlugin
*
* TotalDcmLister - A lister plugin for Total Commander for listing DICOM File content.
*
* Copyright (C) 2015 Captain Stark
*
* This software may be modified and distributed under the terms of the MIT license.
* See the COPYRIGHT file at the top-level directory of this distribution for details.
*/

#pragma once

#include <string>

#include "TotalDcmListerPluginView.h"

using namespace std;

/// <summary>
/// The core logic of Total DICOM Lister plugin.
/// </summary>
class TotalDcmListerPlugin
{
public:
   /// <summary>
   /// Initializes a new instance of the <see cref="TotalDcmListerPlugin"/> class.
   /// </summary>
   TotalDcmListerPlugin();

   /// <summary>
   /// Finalizes an instance of the <see cref="TotalDcmListerPlugin"/> class.
   /// </summary>
   ~TotalDcmListerPlugin();

   /// <summary>
   /// Initializes the plugin view.
   /// </summary>
   /// <param name="parentWindow">The parent window.</param>
   /// <returns>True when initialization has been performed without errors. False otherwise.</returns>
   bool InitializePluginView(const HWND& parentWindow);

   /// <summary>
   /// Gets the plugin's view handle.
   /// </summary>
   /// <returns>A window handle to the plugin's view.</returns>
   HWND GetPluginViewHandle();

   /// <summary>
   /// Loads the content of the given DICOM file to the plugin's view.
   /// </summary>
   /// <param name="fileToLoad">The file to load.</param>
   /// <returns>True when initialization has been performed without errors. False otherwise.</returns>
   bool LoadDicomFileContent(const string& fileToLoad);

   /// <summary>
   /// Sets the settings location by extracting relevant path from the given ini file location.
   /// </summary>
   /// <param name="defaultInifile">The default inifile as provided by Total Commander.</param>
   void SetSettingsLocation(const string& defaultInifile);

private:
   wstring m_settingsLocation;
   TotalDcmListerPluginView* m_pluginView;
};

